<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="ui" uri="http://com.am.tag" %>
<%@ include file="../common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'userList.jsp' starting page</title>
    <script type="text/javascript" src="${path}/js/public/grid.js"></script>
  	<script type="text/javascript">
  	
  		function doEdit()
  		{
  			if(!isSelectOne(mygrid))
  			{
  				alert("请选择一条记录进行修改");
  				return;
  			}
			openDailog("view","${path}/jsp/define/costDefinitionEdit.jsp",540,250,"修改费用定义",false,true,mygrid.getSelectedRecords()[0],function(dlg){
  				
  				dlg.getIFrame().doSave();
  			});
  		}
  		
  		function personTypeRender(value)
  		{
  			if(value == "0"){
  				return "参保学生";
  			}else if(value == "1"){
  				return "教职工";
  			}else if(value == "2"){
  				return "退休人员";
  			}else if(value == "3"){
  				return "离休人员";
  			}else{
  				return "其他人员";
  			}
  		}
  		
  		function percentageRender(value)
  		{
  			if(value || value == 0)
  			{
  				return value + "%";
  			}
  		}
  		
  		function registerTypeRender(value)
  		{
  			if(value == "0"){
  				return "普通";
  			}else{
  				return "急诊";
  			}
  		}
  	</script>
  </head>
  <body>
  	<table id="" cellSpacing="0" cellPadding="0" style="width:100%;height:100%;" border="0">
  		<tr>
			<td class="windowTitle">系统管理  &gt; 费用定义</td>
		</tr>
  		<tr id="">
			<td style="height:35px;width:100%" class="windowHead">	
				<form id="queryForm">
					<table cellSpacing="0" cellPadding="0" width="100%" height="100%" border="0" >
						<tr>
							<td>
								<ui:Permission value="cost_Modify">
									<ui:Button type="edit" onclick="doEdit()">修改</ui:Button>
								</ui:Permission>
							</td>
						</tr>
					</table>
				</form>
				<br/>
				<a style="text-decoration: none;"></a>
			</td>
		</tr>
		<tr id="">
			<td style="width:100%;height:100%;overflow:hidden"  class="windowBody">
				<div id="mess_box" style="width:100%;height:100%;overflow:hidden">
					<ui:Grid id="mygrid" css="width:100%;height:100%"
				    		 onCellClicked="selectedSingleRow2"
				    		 dataProvider="com.system.provider.CostDefinitionListProvider:getData" >
				    	<ui:GridField name="id" header="ID" isChecked="true" align="center"/>
				    	<ui:GridField name="person_type" header="病人类型" align="center" width="16%" render="personTypeRender"/>
				    	<ui:GridField name="register_type" header="挂号类型" align="center" width="12%" render="registerTypeRender"/>
				    	<ui:GridField name="register_amount" header="挂号费" align="center" width="12%"/>
				    	<ui:GridField name="percentage" header="收费比例" align="center" width="14%" render="percentageRender"/>
				    	<ui:GridField name="max_consume" header="单笔最高消费" align="center" width="15%"/>
				    	<ui:GridField name="notes" header="备注" align="center" width="28%"/>
			    	</ui:Grid>
		    	</div>
		    </td>
		</tr>
  	</table>
  	<script type="text/javascript">
		$().ready(function(){
			disableSelectAll(mygrid);
		});
	</script>
  </body>
</html>
